package de.mhus.lib.mandala.attributes;

import java.util.HashMap;
import java.util.Map;

import de.mhus.lib.mandala.Response;
import de.mhus.lib.mandala.Sphere;

public class MultiAttribute extends Sphere {
	
	private HashMap<String, BooleanAttribute> attributes = new HashMap<String, BooleanAttribute>();

	@Override
	protected void doRender(Response out) {
		out.print("{");
		boolean first = true;
		for (Map.Entry<String, BooleanAttribute> item : attributes.entrySet() ) {
			if (!first) out.print(",");
			out.print(item.getKey());
			out.print(":");
			item.getValue().renderBooleanExpression(out);
			first = false;
		}
		out.print("}");
	}

	public Map<String, BooleanAttribute> getAttributes() {
		return attributes;
	}

}
